package com.bins.uaa.user.controller;

import com.bins.uaa.user.api.controller.UserApi;
import com.bins.uaa.user.api.vo.UserVo;
import com.bins.uaa.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController implements UserApi {

    @Autowired
    UserService userService;

    @Override
    @GetMapping("/info")
    public UserVo getUserByName(@RequestParam("userName") String userName) {
        return userService.getUserByUsername(userName);
    }
}
